package com.xmut.dao;

import com.sirdc.modules.core.dao.GenericQuery;
import com.sirdc.modules.core.dao.LongDao;
import com.xmut.entity.TopicPraise;
import org.springframework.stereotype.Repository;

/**
 *
 */
@Repository
public class TopicPraiseDao extends LongDao<TopicPraise>{

    public TopicPraise getByUserIdWithTopicId(String userId, Long topicId) {
        GenericQuery query = createQuery("obj");
        query.append(" and obj.userId = :userId and obj.topicId = :topicId");
        query.setParam("userId",userId).setParam("topicId",topicId);
        return  query.singleResult();
    }
}
